package com.awenhui.demo.core.validation.annotation;

import com.awenhui.demo.core.validation.validator.PhoneNoValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;

/**
 * 手机号码验证注解
 *
 * @author yuxf
 * @version 1.0
 * @date 2020/5/11 15:49
 */
@Target({ElementType.METHOD, ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Constraint(validatedBy = {PhoneNoValidator.class})
public @interface PhoneNo {
    //默认错误消息
    String message() default "手机号格式错误";
    //分组
    Class<?>[] groups() default { };

    //负载
    Class<? extends Payload>[] payload() default { };
}
